<%@page import="com.exam.dao.StudentDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<jsp:include page="checkAdmin.jsp" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <link href="css/style.css" rel="stylesheet" type="text/css" />
   <link href="css/select.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript" src="js/jquery-2.0.js"></script>
   <script type="text/javascript" src="js/select-ui.min.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
   		$(".select2").uedSelect({
			width : 240  
		});
   			
   			
   		$("#switch_1_on").hover(function(){
   			$(this).parent().css("background","url(images/on.png)");
   		},function(){
   			$(this).parent().css("background","url(images/off.png)");
   		});
   		
   		$("#switch_1_off").hover(function(){
   			$(this).parent().css("background","url(images/off.png)");
   		},function(){
   			$(this).parent().css("background","url(images/on.png)");
   		});
   		
   		
   		$("#switch_2_on").hover(function(){
   			$(this).parent().css("background","url(images/on.png)");
   		},function(){
   			$(this).parent().css("background","url(images/off.png)");
   		});
   		
   		$("#switch_2_off").hover(function(){
   			$(this).parent().css("background","url(images/off.png)");
   		},function(){
   			$(this).parent().css("background","url(images/on.png)");
   		});
   		
   });
   		
   </script>
  <style>
  	.switch_on{
  		width:146px;
  		height:40px;
  		background: url(images/off.png);
  		float:left;
  		margin:5px 0 10px 0;
  	}
  	.switch_off{
  		width:146px;
  		height:40px;
  		background: url(images/on.png);
  		float:left;
  		margin:5px 0 10px 0;
  	}
  	 a.off{
    	display: block;
    	width:66px;
    	height:32px;
    	margin:3px 7px 0 0;
    	float:right;
    }
    a.on{
    	display: block;
    	width:70px;
    	height:32px;
    	margin:3px 0 0 3px;
    }
  </style>
</head>

<body>
<div id="loading" style="font-size:14px;"></div>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="index.jsp">首页</a></li>
    <li><a href="setting.action">系统设置</a></li>
    </ul>
    </div>
    
    <div class="formbody">
    <div class="formtitle"><span>系统设置</span></div>
	   <form action="setting-save.action" method="POST" id="SettingSaveForm">
	       <input type="hidden" name="id" value="${SYS_SETTING.id }"/>
	    <ul class="forminfo">
	    <li><p style="color:red" class="stu_error">${fieldErrors.stu_name[0] }</p></li>
	    <li><label>是否开放注册:</label>
	    	<s:if test="#application.SYS_SETTING.isRegister==1">
		    	<div class="switch_off">
	    		    <a href="setting-isRegister.action?type=0" class="off" id="switch_1_off" title="点击OFF关闭功能" ></a>
	    		</div>
	    	</s:if>
	    	<s:else>
	    		<div class="switch_on" >
		    		<a href="setting-isRegister.action?type=1" class="on" id="switch_1_on" title="点击ON开启功能" ></a>
		    	</div>
	    	</s:else>
	    </li>
	    <li><label>是否开放错题:</label>
	    	<s:if test="#application.SYS_SETTING.isOpenErrQue==1">
		    	<div class="switch_off">
	    		    <a href="setting-isOpenErrQue.action?type=0" class="off" id="switch_2_off" title="点击OFF关闭功能" ></a>
	    		</div>
	    	</s:if>
	    	<s:else>
	    	    <div class="switch_on" >
		    		<a href="setting-isOpenErrQue.action?type=1" class="on" id="switch_2_on" title="点击ON开启功能" ></a>
		    	</div>
	    		
	    	</s:else>
	    </li>
	    <li><label>分页数据条数:</label>
	    <div class="vocation">
	   		<select class="select2" name="pageSize" id="pageSize">
	    	<s:iterator  begin="4" end="12" status="list">
			   <s:if test="#application.SYS_SETTING.pageSize==#list.index+4">
			     <option selected="selected" value="<s:property value="#list.index+4"/> ">每页显示 <s:property value="#list.index+4"/> 条</option>
				</s:if>
				<s:else>
				 <option value="<s:property value="#list.index+4"/> ">每页显示 <s:property value="#list.index+4"/> 条</option>
				</s:else>
			</s:iterator>
		    
	  	  	</select>
	    </div>	
	    </li>
	    <li><label>系统版权信息:</label>
	    	<textarea name="copyright" cols="" rows="" class="textinput" style="width:240px;height:90px">${SYS_SETTING.copyright }</textarea>
	    </li>
	    <li><label>&nbsp;</label><input  type="submit" class="btn" value="更改设置"/></li>
	    </ul>
	    </form>
    </div>
</body>
</html>
